]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
portalHelper: Handle Ctrl+W/Ctrl+Q to close window
authorBastien Nocera <hadess@hadess.net>
Tue, 17 Jan 2017 14:01:01 +0000 (15:01 +0100)
committerBastien Nocera <hadess@hadess.net>
Thu, 19 Jan 2017 13:04:34 +0000 (14:04 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=764133

js/portalHelper/main.js

index 427fd85c5135edec7d86e04d8bbbbe973a16bb0c..39846420edab74b8941ef31b31de897c682dfac3 100644 (file)
@@ -74,6 +74,8 @@ const PortalWindow = new Lang.Class({
         this._webView.show();
         this.maximize();
         this.present_with_time(timestamp);
+
+        this.application.set_accels_for_action('app.quit', ['<Primary>q', '<Primary>w']);
     },
 
     _syncTitle: function() {
@@ -168,6 +170,10 @@ const WebPortalHelper = new Lang.Class({
 
         this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(HelperDBusInterface, this);
         this._queue = [];
+
+        let action = new Gio.SimpleAction({ name: 'quit' });
+        action.connect('activate', () => { this.active_window.destroy(); });
+        this.add_action(action);
     },
 
     vfunc_dbus_register: function(connection, path) {